#ifndef EVENTADAPTER_H
#define EVENTADAPTER_H

#include <amk3/amk3.h>
#include <QEvent>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QWheelEvent>

#include <osg/Camera>
#include <osgEarthUtil/EarthManipulator>


class AMK_API EventAdapterOptions
{
public:
    int view_width;
    int view_height;
    double currentTime;
};

class AMK_API EventAdapter
{
public:
    EventAdapter();

    virtual void mousePressEvent(QMouseEvent *event);
    virtual void mouseDoubleClickEvent(QMouseEvent *event);
    virtual void mouseReleaseEvent(QMouseEvent* event);
    virtual void mouseMoveEvent(QMouseEvent *event);
    virtual void wheelEvent(QWheelEvent* event);
    virtual void keyPressEvent(QKeyEvent* event);
    virtual void keyReleaseEvent(QKeyEvent* event);

    void setOptions(const EventAdapterOptions& options);
    inline EventAdapterOptions& getOptions(){return _options;}

    void preFrame(double time);
    void endFrame(double time);

    //void setManipulatorMode(ManipulatorMode b);

protected:
    EventAdapterOptions _options;
    //EventAdapterInspace* _adapterInspace;
    //EventAdapterOsgEarth* _adapterOsgEarth;
    //是否采用地球的漫游器
    //ManipulatorMode _manipulatorMode;
    bool _activeEarthAdapter;
};

#endif // EVENTADAPTER_H
